<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$title}-{$Think.lang.web_name}</title>
    {include file="comm/header"/}
</head>
<body>
{include file="comm/left_menu"/}
{include file="comm/top_menu"/}
<div class="container main">
    <div class="col-sm-12 border-bottom text-right"><a class="btn btn-primary mgr-10" href="/power/admin_list/id/{$admin.member_id}"><i class="fa fa-list-ul"></i>&nbsp;{$Think.lang.admin_list}</a></div>

    <div class="col-sm-12">
        <div class="col-sm-12"> &nbsp;</div>
        <form class="form-horizontal" method="post" action="/power/admin_save/">

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_user}</label>
                <div class="col-sm-3">
                    <input class="form-control" name="member_user" value="{$admin.member_user}" required placeholder="必填">
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_password}</label>
                <div class="col-sm-3">
                    {if $admin.member_id}
                    <input type="password" class="form-control" name="member_password" value="" placeholder="如果为空则不修改" >
                    {else}
                    <input type="password" class="form-control" name="member_password" value="" placeholder="必填" required minlength="6">
                    {/if}
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_salt}</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="member_salt" value="{if $admin.member_salt}{$admin.member_salt}{else}{:mt_rand(1000,9999)}{/if}" readonly >
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_sex}</label>
                <div class="col-sm-3">
                    <label class="s-label-radio">
                        <input type="radio" id="member_sex_0" class="radio radio-inline" name="member_sex" value="0" {if in_array($admin.member_sex,[0,""])}checked{/if} >
                        <label class="fa fa-check" for="member_sex_0"></label> {$Think.lang.member_sex_0}
                    </label>
                    <label class="s-label-radio">
                        <input type="radio" id="member_sex_1" class="radio radio-inline" name="member_sex" value="1" {if in_array($admin.member_sex,[1])}checked{/if}>
                        <label class="fa fa-check" for="member_sex_1"></label> {$Think.lang.member_sex_1}
                    </label>
                    <label class="s-label-radio">
                        <input type="radio" id="member_sex_2" class="radio radio-inline" name="member_sex" value="2" {if in_array($admin.member_sex,[2])}checked{/if}>
                        <label class="fa fa-check" for="member_sex_2"></label> {$Think.lang.member_sex_2}
                    </label>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_phone}</label>
                <div class="col-sm-3">
                    <input class="form-control" name="member_phone" value="{$admin.member_phone}">
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_qq}</label>
                <div class="col-sm-3">
                    <input class="form-control" name="member_qq" value="{$admin.member_qq}">
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_email}</label>
                <div class="col-sm-3">
                    <input type="email" class="form-control" name="member_email" value="{$admin.member_email}">
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.member_group}</label>
                <div class="col-sm-3">
                    <select name="member_group" class="form-control">
                        <option value="0">{$Think.lang.select}</option>
                        {foreach name="member_group_list" key="key" id="v" index="i"}
                        <option value="{$v.group_id}" {if $v.group_id == $admin.member_group}selected{/if}>{$v.group_title}</option>
                        {/foreach}
                    </select>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.admin_type}</label>
                <div class="col-sm-6">

                    <label class="s-label-radio">
                        <input type="radio" id="is_admin_1" class="radio radio-inline" name="is_admin" value="1" {if in_array($admin.is_admin,[1])}checked{/if}>
                        <label class="fa fa-check" for="is_admin_1"></label> {$Think.lang.is_admin_1}
                    </label>
                    <label class="s-label-radio">
                        <input type="radio" id="is_admin_2" class="radio radio-inline" name="is_admin" value="2" {if in_array($admin.is_admin,[2,""])}checked{/if}>
                        <label class="fa fa-check" for="is_admin_2"></label> {$Think.lang.is_admin_2}
                    </label>
                </div>
                <small class="col-sm-1 form-tips"></small>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-3">
                    <input type="hidden" name="member_id" value="{$admin.member_id}">
                    <input type="hidden" name="admin_org_type" value="0">
                    <input type="hidden" name="admin_org_id" value="1">
                    <input type="hidden" name="token" value="">
                    <button class="btn btn-primary" type="submit">提交保存</button>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

        </form>
    </div>
</div>

{include file="comm/footer"/}
<script type="text/javascript">
    function all_select() {
        var checked = $("input[name='admin_rules[]']");
        for (var i=0,len=checked.length;i<len;i++){
            checked[i].checked = true;
        }
    }
    function not_all_select() {
        var checked = $("input[name='admin_rules[]']");
        //$("input[name='admin_rules[]']").removeAttr("checked");
        //$("input[name='admin_rules[]']").attr("checked",false);
        for (var i=0,len=checked.length;i<len;i++){
            checked[i].checked = false;
        }
    }

</script>
</body>
</html>